package org.rednebula.framework.core.service;


import org.rednebula.framework.core.IEnvironment;
import org.rednebula.framework.core.model.domain.IModel;
import org.rednebula.framework.core.model.domain.ModelFactory;
import org.rednebula.framework.core.model.domain.RootModel;
import org.rednebula.framework.core.model.form.IForm;
import org.rednebula.framework.core.utils.ExtendsStringUtils;


public abstract class AbstractHandlerService implements IHandlerService {

	protected RootModel getRootModel(){
		return new RootModel();
	}
	
	public IModel create(IEnvironment env, IForm form) {
		// TODO Auto-generated method stub

		return null;
	}

	public IModel delete(IEnvironment env, IForm form) {
		// TODO Auto-generated method stub
		return null;
	}

	public IModel find(IEnvironment env, IForm form) {
		// TODO Auto-generated method stub
		IModel m;
		return null;
	}

	public IModel modify(IEnvironment env, IForm form) {
		// TODO Auto-generated method stub
		return null;
	}

	public IModel other(IEnvironment env, IForm form) {
		// TODO Auto-generated method stub
		return null;
	}
	
	public <T> T getModel(Class<T> cls,IEnvironment env){
		return (T)ModelFactory.getModel(cls, env);
	}
	public <T> T getModel(String name,IEnvironment env){
		return (T)ModelFactory.getModel(name, env);
	}
	
	public String buildStringIdent(IEnvironment env,String name){
		return ServiceFacade.getStringIdentService(env).build(env, name);
	}
	
	protected String toLowerInitName(Class<?> cls){
		return ExtendsStringUtils.toLowerInitName(cls);
	}
	
	
	
}
